/* Ejercicio 4.38
   ejer4_38.c */
#include <stdio.h>

/* function main begins program execution */
int main( void )
{
    int population, incrementRate, year, lastpopulation;

    printf( "Enter the actual population: " );
    scanf( "%d", &population );
    printf( "Enter the annual world population growth rate: " );
    scanf( "%d", &incrementRate );

    printf( "%5s%20s%20s\n", "Year", "World population", "Increment" );
    year = 1;
    lastpopulation = population;

    while ( year <= 75 ) {
        lastpopulation = population;
        population += population * incrementRate / 100;
        printf( "%5d%20d%20d\n", year, population, population - lastpopulation );
        ++year;
    }

    return 0; /* indicate that program ended successfully */
} /* end function main */
